[TOOLS] A couple of check-script cleanups.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 14 Dec 2006 15:12:38 +0000 (15:12 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 14 Dec 2006 15:12:38 +0000 (15:12 +0000)
Signed-off-by: Keir Fraser <keir@xensource.com>
tools/check/check_python
tools/check/check_python_xml

index e56f5a9684f7c40469125de647eda83a61bcca63..6d665ea4b24f2a4b6a6f042d1deb20d2ba36eb7a 100755 (executable)
@@ -3,7 +3,10 @@
 
 RC=0
 
-python -V 2>&1 | cut -d ' ' -f 2 | grep -q '^2.[2345]' || RC=1
+python -c '
+import sys
+sys.exit(sys.version_info[0] < 2 or sys.version_info[1] < 2)
+' || RC=1
 
 if test ${RC} -ne 0; then
        echo
index 95174f46886aa589ca8ffc5be2b806ff99cb616b..de9ebac09cc237bc04c328189d4c43cb22b4aec6 100755 (executable)
@@ -1,11 +1,7 @@
 #!/bin/bash
 # CHECK-INSTALL
 
-function error {
-    echo
-    echo "  *** Check for python-xml package FAILED"
-    exit 1
-}
+RC=0
 
 python -c '
 import os.path, sys
@@ -13,4 +9,11 @@ for p in sys.path:
        if os.path.exists(p + "/xml/dom/minidom.py"):
                sys.exit(0)
 sys.exit(1)
-' || error
+' || RC=1
+
+if test ${RC} -ne 0; then
+    echo
+    echo "  *** Check for python-xml package FAILED"
+fi
+
+exit ${RC}